<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
    <title>商家入驻申请</title>
    <link rel="stylesheet" type="text/css" href="css/webbase.css"/>
    <link rel="stylesheet" type="text/css" href="css/pages-register.css"/>


</head>

<body>
<div class="register py-container ">
    <!--head-->
    <div class="logoArea">
        <a href="" class="logo"></a>
    </div>
    <!--register-->
    <div class="registerArea">
        <h3>商家入驻申请<span class="go">我有账号，去<a href="shoplogin.html" target="_blank">登陆</a></span></h3>
        <div class="info">
            <form id="divfrom" class="sui-form form-horizontal">

                <div class="control-group">
                    <label class="control-label">登陆名（不可修改）：</label>
                    <div class="controls">
                        <input type="text" name="sellerId" placeholder="登陆名" class="input-xfat input-xlarge">
                        <!--onblur="sellerIdAndSellerName()-->
                        <span id="span"></span>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">登陆密码：</label>
                    <div class="controls">
                        <input type="password" name="password" placeholder="登陆密码" class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">店铺名称：</label>
                    <div class="controls">
                        <input type="text" name="nickName" placeholder="店铺名称" class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">公司名称：</label>
                    <div class="controls">
                        <input type="text" name="name" placeholder="公司名称" class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">公司电话：</label>
                    <div class="controls">
                        <input type="text" name="telephone" placeholder="公司电话" class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">公司详细地址：</label>
                    <div class="controls">
                        <input type="text" name="addressDetail" placeholder="公司详细地址" class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">联系人姓名：</label>
                    <div class="controls">
                        <input type="text" name="linkmanName" placeholder="联系人姓名" class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">联系人QQ：</label>
                    <div class="controls">
                        <input type="text" name="linkmanQq" placeholder="联系人QQ" class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">联系人手机：</label>
                    <div class="controls">
                        <input type="text" name="linkmanMobile" placeholder="联系人手机" class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">联系人EMAIL：</label>
                    <div class="controls">
                        <input type="text" name="linkmanEmail" placeholder="联系人EMAIL" class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">营业执照号：</label>
                    <div class="controls">
                        <input type="text" name="licenseNumber" placeholder="营业执照号" class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">税务登记证号：</label>
                    <div class="controls">
                        <input type="text" name="taxNumber" placeholder="税务登记证号" class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">组织机构代码证：</label>
                    <div class="controls">
                        <input type="text" name="orgNumber" placeholder="组织机构代码证" class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">法定代表人：</label>
                    <div class="controls">
                        <input type="text" name="legalPerson" placeholder="法定代表人" class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">法定代表人身份证号：</label>
                    <div class="controls">
                        <input type="text" name="legalPersonCardId" placeholder="法定代表人身份证号"
                               class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">开户行名称：</label>
                    <div class="controls">
                        <input type="text" name="bankUser" placeholder="开户行名称" class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">开户行支行：</label>
                    <div class="controls">
                        <input type="text" name="bankName" placeholder="开户行支行" class="input-xfat input-xlarge">
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">银行账号：</label>
                    <div class="controls">
                        <input type="text" name="bankAccount" placeholder="银行账号" class="input-xfat input-xlarge">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                    <div class="controls">
                        <input name="m1" type="checkbox" value="2" checked=""><span>同意协议并注册  <a
                            href="/indexController/toSampling">《东东商城商家入驻协议》</a></span>
                    </div>
                </div>
            </form>
            <div class="control-group">
                <label class="control-label"></label>
                <div class="controls btn-reg">
                    <input type="button" class="sui-btn btn-block btn-xlarge btn-danger" value="申请入驻"
                           onclick="Register()">
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
    </div>
    <!--foot-->
    <div class="py-container copyright">
        <ul>
            <li>关于我们</li>
            <li>联系我们</li>
            <li>联系客服</li>
            <li>商家入驻</li>
            <li>营销中心</li>
            <li>手机东东商城</li>
            <li>销售联盟</li>
            <li>东东商城社区</li>
        </ul>
        <div class="address">地址：北京市昌平区沙阳路18号 邮编：100000 电话：400-0123-302</div>
        <div class="beian">京ICP备08006666号京公网安备11010888888
        </div>
    </div>
</div>


<script type="text/javascript" src="js/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript" src="js/plugins/jquery.easing/jquery.easing.min.js"></script>
<script type="text/javascript" src="js/plugins/sui/sui.min.js"></script>
<script type="text/javascript" src="js/plugins/jquery-placeholder/jquery.placeholder.min.js"></script>
<script type="text/javascript" src="js/pages/register.js"></script>

<!--引入自定义文件-->
<script src="js/pages/public.js"></script>
</body>
<script th:inline="javascript">
    function Register() {
        let serializeObject = $("#divfrom").serializeObject();
        // console.log(serializeObject)
        $.ajax({
            url: domain + "/seller/register",
            headers: {'Autherizetion': window.localStorage.getItem("token")},//获取浏览器缓存中的token进行过滤器放过
            contentType: "application/json;charset=utf-8",//我将来要往前台发送数据的时候是以json的格式发送的
            dataType: "json",
            type: "post",//必须指定请求类型
            data: JSON.stringify(serializeObject),
            success: function (result) {
                console.log(result)
                if (result.code == 6) {
                    alert(result.message)
                } else if (result.code == 4) {
                    console.log(result)
                    alert(result.message)
                    top.window.location.href = "../login.html";//注册后如果不登录就无法通过token修改资料
                } else if (result.code == 12) {
                    top.window.location.href = "../login.html";//token失效 跳转回登录界面  重新登录生成token  放进缓存  重新获取
                }
            }, error: function () {
                alert("修改资料异常，请联系管理员")
            }
        })
    }
</script>
</html>